{include file="public/header" /}
</head>
<body>
<form class="layui-form layui-form-pane" action="" style="width: 80%;margin: 20px auto;">
    <input type="hidden" name="classification_id" value="{$dataInfo.classification_id|default=0}">
    {notempty name="SUBSTATIONS"}
    <input type="hidden" name="substation_id" value="{$dataInfo.substation_id|default=$SUBSTATIONS}">
    {/notempty}
    <div class="layui-form-item">
        <label class="layui-form-label">分类名称</label>
        <div class="layui-input-block">
            <input type="text" name="classification_name"  required lay-verify="required"  placeholder="请输入分类名称" autocomplete="off" class="layui-input" value="{$dataInfo.classification_name|default=''}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">上级分类</label>
        <div class="layui-input-block">
            <select name="parent_id" lay-search>
                <option value="0">顶级分类</option>
                {notempty name="classificationList"}
                {volist name="classificationList" id="tl"}
                <option value="{$tl.classification_id}" {present name="dataInfo.parent_id"}{if condition="$tl['classification_id'] == $dataInfo['parent_id']"}selected{/if}{/present}>{notempty name="$tl.level_name"}{$tl.level_name}&ensp;{/notempty}{$tl.classification_name}</option>
                {/volist}
                {/notempty}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="text" name="sort" required lay-verify="required"  placeholder="请输入排序，（0 - 999）" autocomplete="off" class="layui-input" value="{$dataInfo.sort|default=''}">
        </div>
    </div>
    <div class="layui-form-item" pane>
        <label class="layui-form-label">首页显示</label>
        <div class="layui-input-block">
            {notempty name="RadioIs"}
            {volist name="RadioIs" id="vo"}
            <input type="radio" name="is_index" value="{$key}" title="{$vo}" {present name="dataInfo.is_index"}{eq name="dataInfo.is_index" value="$key"}checked{/eq}{else/}{eq name="key" value="0"}checked{/eq}{/present}>
            {/volist}
            {/notempty}
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">案例分类描叙</label>
        <div class="layui-input-block">
            <textarea name="description" placeholder="请输入案例分类描叙" class="layui-textarea">{$dataInfo.description|default=''}</textarea>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">SEO关键字</label>
        <div class="layui-input-block" >
            <textarea name="seo_keyword" placeholder="请输入SEO关键字" class="layui-textarea">{$dataInfo.seo_keyword|default=''}</textarea>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">SEO描叙</label>
        <div class="layui-input-block">
            <textarea name="seo_description" placeholder="请输入SEO描叙" class="layui-textarea">{$dataInfo.seo_description|default=''}</textarea>
        </div>
    </div>
    {empty name="SUBSTATIONS"}
    <div id="substation_type">
        <div class="layui-form-item" pane>
            <label class="layui-form-label">发布网站</label>
            <div class="layui-input-block">
                {notempty name="userSubstationList"}
                {volist name="userSubstationList" id="vo"}
                <input type="radio" name="substation_id" value="{$vo.substation_id}" title="{$vo.substation_name}"  {notempty name="dataInfo.substation_id"}{if condition="$dataInfo['substation_id'] eq $vo['substation_id']"}checked{/if}{/notempty}>
                {/volist}
                {/notempty}
            </div>
        </div>
    </div>
    {/empty}
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" type="button" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
</body>
<script>
    layui.use('form', function(){
        var form = layui.form;
        form.render();
        //监听提交
        form.on('submit(formDemo)', function(data){
            post_sub("{:url('Cases/classificationAdd')}",data.field);
            return false;
        });
    });
</script>
</html>